<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

// 第二次增强优惠券功能: 1.增加限定商品优惠&全场商品优惠&品牌商品优惠等, 2.增加限定领取数量功能(之前只能领取一张)
class AddSecondSomeColumnsToCouponCodes extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('coupon_codes', function (Blueprint $table) {
            $table->string('coupon_codeable_type')->nullable()->comment('多态关联类型');
            $table->string('coupon_codeable_id')->nullable()->comment('多态关联id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('coupon_codes', function (Blueprint $table) {
            //
        });
    }
}
